package com.zytlifeservice.domain.pay;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

/**
 * Created by MJS on 2017/5/26.
 */
@Entity
public class AlipayOrder {

    //订单的状态，异常的话需要进行人工介入。
    public static final int ORDER_WAIT = 0;

    public static final int ORDER_SUCCESS = 1;

    public static final int ORDER_FAIL = 2;

    public static final int ORDER_EXCEPTION = 3;

    //订单状类型说明
    public static final int TYPE_MOBILE_RECHARGE = 0;   //话费
    public static final int TYPE_MOBILE_FLOW = 1;    //流量
    public static final int TYPE_CATV = 2;  //有线电视
    public static final int TYPE_GHKD_RECHARGE = 3;  //宽带固话
    public static final int TYPE_WATER = 4;  //水费
    public static final int TYPE_ELECTRIC = 5;  //电费
    public static final int TYPE_COAL = 6;  //燃气费

    public static final int TYPE_TRAIN=7;//火车票

    public static final int TYPE_AIRPLANE=8;//飞机票

    @Id
    @GeneratedValue
    private Long id;
    //------------------------------------自定义参数-----------------------------------
    private int type;  //支付宝对应的千米订单类型 0话费-1宽带-2水电煤-3广电-4-5-6

    private Long userId;  //对应的用户ID

    private int OrderStatus;  //默认待支付，成功，失败，异常（需人工介入）

    private String refundReason;  //退款原因

    private int refundStatus = 1; //退款状态  -1,异常，需要人工介入  0，成功,1--不需要退款  //默认状态

    private String gmt_create;  //支付宝预下单创建时间

    //------------------------------------支付宝预下单参数-----------------------------------
    private String outTradeNo;  //必传  外部订单号

    private String subject;  //必传，支付宝显示的缴费名称

    private String storeId;  // (必填) 商户门店编号，通过门店号和商家后台可以配置精准到门店的折扣信息，详询支付宝技术支持

    private String totalAmount;  //必传 预下单金额
    //-----------------------------------支付宝回调返回的参数-----------------------------------------------
    private String trade_no;   //支付宝交易码

    private String gmt_payment; //支付宝付款时间

    public int status = 1;  //预留字段
    //-----------------------------------------------------------------------------------------------------

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public int getOrderStatus() {
        return OrderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        OrderStatus = orderStatus;
    }

    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    public int getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(int refundStatus) {
        this.refundStatus = refundStatus;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getTrade_no() {
        return trade_no;
    }

    public void setTrade_no(String trade_no) {
        this.trade_no = trade_no;
    }

    public String getGmt_payment() {
        return gmt_payment;
    }

    public void setGmt_payment(String gmt_payment) {
        this.gmt_payment = gmt_payment;
    }

    public String getGmt_create() {
        return gmt_create;
    }

    @Override
    public String toString() {
        return "AlipayOrder{" +
                "id=" + id +
                ", type=" + type +
                ", userId=" + userId +
                ", OrderStatus=" + OrderStatus +
                ", refundReason='" + refundReason + '\'' +
                ", refundStatus=" + refundStatus +
                ", gmt_create='" + gmt_create + '\'' +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", subject='" + subject + '\'' +
                ", storeId='" + storeId + '\'' +
                ", totalAmount='" + totalAmount + '\'' +
                ", trade_no='" + trade_no + '\'' +
                ", gmt_payment='" + gmt_payment + '\'' +
                '}';
    }

    public void setGmt_create(String gmt_create) {


        this.gmt_create = gmt_create;
    }

}
